package com.car.dal.dao.performance;

import com.car.dal.dao.ibatis.IbatisCommonDao;
import com.car.dal.object.PerformanceInfo;
import com.car.util.Page;

import java.util.List;

/**
 * Created by AoSnow on 2017/4/25.
 */
public class PerformanceInfoDaoImpl extends IbatisCommonDao<PerformanceInfo, Long> implements PerformanceInfoDao {


    @Override
    public Integer getPerformanceInfoCount(PerformanceInfo performanceInfo) {
        return this.queryForInteger("getPerformanceInfoCount", performanceInfo);
    }

    @Override
    public List<PerformanceInfo> getPerformanceInfoList(PerformanceInfo performanceInfo,Page page) {
    	performanceInfo.setFirstrownum(page.getFirstrownum());
    	performanceInfo.setPagesize(page.getPagesize());
        return this.queryForEntityList(PerformanceInfo.class,"getPerformanceInfoList", performanceInfo);
    }
    
    @Override
    public PerformanceInfo getPerInfoList(PerformanceInfo performanceInfo) {
    	List<PerformanceInfo> list = this.queryForEntityList(PerformanceInfo.class,"getPerInfoList", performanceInfo);
        if(list!=null && list.size()>0){
        	return list.get(0);
        }
    	return null;
    }

}
